#include "thread.hpp"
#include <unistd.h>

using namespace TheadModle;

class ThreadData
{
public:
    pthread_t tid;
    std::string name;
};

void Count(ThreadData td)
{
    while (true)
    {
        std::cout << "我是一个新线程" << std::endl;
        std::cout << "我的tid是" <<td.tid<< std::endl;
        sleep(1);
    }
}

int main()
{
    ThreadData td;
    td.tid = 777;
    td.name = "fx";

    Thread<ThreadData> t(Count, td);
    t.Start();

    t.Join();
    sleep(3);

    t.Stop();
    sleep(2);

    t.Join();
    

    return 0;
}